import typescript from '@rollup/plugin-typescript';
import path from 'path';
import { nodeResolve } from '@rollup/plugin-node-resolve';
import commonjs from '@rollup/plugin-commonjs';
// import nodePolyfills from 'rollup-plugin-node-polyfills';
import json from '@rollup/plugin-json'


export default {
  input: "src/index.ts",
  output: [
    {
      file: "dist/index.mjs",
      sourcemap: true,
    },
    {
      file: "dist/index.cjs",
      sourcemap: true,
      // plugins: [terser()]
    }
  ],
  plugins: [
    typescript({
      tsconfig: path.resolve(__dirname, 'tsconfig.json')
    }),
    nodeResolve(
      // {
      //   preferBuiltins: false 
      // }
    ),
    commonjs(),
    json()
  ],
};
